﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Security.Principal;

namespace eLibServer.Core.Services.Authentication
{
  public class eLibBasePrincipal : IPrincipal
  {

    private eLibBaseIdentity _user = null;

    #region IPrincipal Members

    public IIdentity Identity
    {
      get { return _user; }
      internal set { _user = value as eLibBaseIdentity; }
    }

    public bool IsInRole(string role)
    {
      return _user != null ? _user.IsInRole(role) : false;
    }

    #endregion

    public eLibBasePrincipal(eLibBaseIdentity user)
		{
			_user = user;
		}
  }
}
